package ex2.pukepaiTEST01;

/**
 * @AUTHOR 尹书岿
 * @DATE 2024/12/10 19:16
 * @DESCRIBE
 */
public class Card {
    String suit;
    Integer rank;

    public Card(String suit, Integer rank) {
        this.suit = suit;
        this.rank = rank;
    }

    @Override
    public String toString() {
        String new_rank = "";
        switch (rank) {
            case 1:
                new_rank = "A";
                break;
            case 11:
                new_rank = "J";
                break;
            case 12:
                new_rank = "Q";
                break;
            case 13:
                new_rank = "K";
                break;
            default:
                new_rank = rank.toString();
        }

        return  suit + new_rank;
    }

    public static void main(String[] args) {
        Card card = new Card("红桃",11);
        System.out.println(card);
    }
}
